<template>
  <div class="c-bg-sgray orderList">
    <div class="c-bg-white c-br-br20 c-br-bl20">
      <my-small-tabbar :tabList="tabList" :tabIndex="type" @changeTab="changeType" :isScroll="true" :flexClass="''" class="c-ph24"></my-small-tabbar>
    </div>
    <div class="" v-if="orderList.length > 0 && type != 4">
      <div class="c-bg-white c-flex-column c-ph24 c-br20" :class="index == 0 ? 'c-mt10' : 'c-mt12'" v-for="(item,index) in orderList" :key="index">
        <div class="c-bd-b1 c-flex-row c-justify-sb c-pv24">
          <div class="c-lh c-fc-gray c-fs20 c-flex-row c-aligni-center">
            <span>{{item.createdAt}}</span>
            <span class="theme-bg c-fc-white c-fs20 c-pv4 c-ph8 c-br4 c-ml12" v-if="item.deliverType == 2">自提</span>
          </div>
          <div class="c-lh c-fs22 theme-fc">{{orderStatus[item.status]}}</div>
        </div>
        <div class="c-flex-row c-pt20 c-pb20" @click="clickPay(item)" v-for="(cItem,cIndex) in item.orderDetail" :key="cIndex">
          <div class="c-ww180 c-hh180 c-text-hidden c-br10">
            <img :src="$addXossFilter(cItem.avatar, require('@/assets/defult270.png'))" class="c-w100 c-h c-br10 imgCloseBig c-object-fit-cover" />
          </div>
          <div class="c-flex-column c-justify-sb c-hh180 c-pl20 c-w0 c-flex-grow1">
            <div class="c-flex-row c-justify-sb c-w100">
              <div class="c-maxw316">
                <div class="c-fs24 c-text-ellipsis1 c-lh34">
                  <span v-if="cItem.isGift && cItem.isGift == 1" class="c-fs20 theme-bd1 theme-fc c-ph4 c-pv2 c-br4 c-mr10">赠品</span>
                  <span v-if="item.type == 2" class="c-fs20 theme-bg c-fc-white c-mr4 c-textAlign-c c-br4 c-pv4 c-ph8 c-br20">限时{{Number(cItem.price) == 0 ? '免费' : '折扣'}}</span>{{cItem.goodsName}}
                </div>
                <div class="c-fs20 c-fc-gray c-mt10" v-if="cItem.subSpecs">规格：{{cItem.subSpecs}}</div>
              </div>
              <div class="c-flex-column c-aligni-end">
                <span class="c-fs24 c-fc-xblack">{{'￥' | iosPriceFilter}}{{cItem.price}}</span>
                <span class="c-fs20 c-fc-gray c-mt5">x {{cItem.quantity}}</span>
              </div>
            </div>
            <div class="c-flex-row c-aligni-center c-justify-end">
              <span class="theme-fc c-fs20 c-w0 c-flex-grow1" v-if="item.status == 1 && cItem.deliverStatus == 2">已发货</span>
              <span class="theme-fc c-fs20" v-if="cItem.afterStatus > 0">{{cItem.afterStatus == 1 ? '退款中' : '退款成功'}}</span>
            </div>
          </div>
        </div>
        <div class="c-flex-column c-aligni-end">
          <div class="c-flex-row c-aligni-center c-justify-end c-bd-b1-f6 c-pb24 c-w100">
            <div class="c-lh28 c-fc-gray c-fs20 c-ml14" v-if="item.deliverType != 2">
              <span v-if="item.postage * 1 == 0" class="c-fc-xblack">免邮费<span class="c-fs28"> </span></span>
              <span v-else>邮费：{{'￥' | iosPriceFilter}}<span class="c-fs28" v-html="item.postage">{{item.postage}},</span></span>
            </div>
            <div class="c-flex-column c-aligni-end c-ml14" v-if="item.totalDiscountPrice * 1 != 0">
              <div class="c-lh28 c-fc-gray c-fs20" v-if="item.totalDiscountPrice * 1 != 0">优惠金额：{{item.totalDiscountSign == 1 ? '+' : '-'}}{{'￥' | iosPriceFilter}}<span v-html="item.totalDiscountPrice" class="c-fs28">{{item.totalDiscountPrice}},</span></div>
            </div>
            <div class="c-lh28 c-fc-xblack c-fs20 c-ml14">实际付款：{{'￥' | iosPriceFilter}}<span class="c-fs28" v-html="item.payMoney">{{item.payMoney}}</span></div>
          </div>
          <!-- 添加此处按钮,需要考虑一下内页也有相同按钮,操作完之后,页面要怎么局部更新 -->
          <div class="c-lh c-fs24 c-flex-row c-justify-end c-aligni-center">
            <div v-show="[-1,-2,-3,-5].includes(item.status)" class="c-pv30">
              <div class="c-bd1 c-br24 c-fs24 c-pv12 c-ph24 c-ml20" @click="clickCancelOrder(item.goId, 1)">删除订单</div>
            </div>
            <div v-show="item.status == 0" class="c-pv30">
              <div class="c-bd1 c-br24 c-fs24 c-pv12 c-ph24 c-ml20" @click="clickCancelOrder(item.goId, 2)">取消订单</div>
            </div>
            <div v-show="(item.status == 0 || (item.status == 1 && item.isSendSomeGoods == 0)) && item.updateAddressTime == null && item.orderDetail[0].deliverType != 2" class="c-pv30">
              <div class="c-bd1 c-br24 c-fs24 c-pv12 c-ph24 c-ml20" @click="handleClickAddress(item.goId)">修改地址</div>
            </div>
            <div v-show="showLogistics(item)" class="c-pv30">
              <div class="c-bd1 c-br24 c-fs24 c-pv12 c-ph24 c-ml20" @click="clickLogistics(index, item.isSplitPackage, item.goId)">物流信息</div>
            </div>
            <div v-show="item.status == 0" class="c-pv30">
              <div class="theme-bd1 c-br24 c-fs24 theme-fc c-pv12 c-ph24 c-ml20" @click="clickPay(item)">付款</div>
            </div>
            <div v-show="item.status == 3 && (item.isCommented == 0 || !item.isCommented)" class="c-pv30">
              <div class="c-fs24 c-lh32 c-pv8 c-ph24 c-br24 c-ml20 theme-bd1 theme-fc" @click="goComments(item)">评价</div>
            </div>
            <div v-show="item.status == 2 && item.fromApp != 10" class="c-pv30">
              <div class="theme-bd1 c-br24 c-fs24 theme-fc c-pv12 c-ph24 c-ml20" @click="clickConfirmReceipt(item)">确认收货</div>
            </div>
            <div v-show="item.payAward != null" class="c-pv30">
              <div class="theme-bd1 c-br24 c-fs24 theme-fc c-pv12 c-ph24 c-ml20" @click="clickPay(item)">支付有礼</div>
            </div>
            <div class="c-fs24 c-fc-xblack c-ml20 c-pv30" v-show="item.status == 1 && item.deliverType == 2 && item.deliverNo && item.deliverNo.length > 0">提货码：{{item.deliverNo}}</div>
          </div>
        </div>
      </div>
    </div>
    <div v-if="type == 4 && refundList.length > 0">
      <div class="c-bg-white c-flex-column c-ph24 c-br20" :class="index == 0 ? 'c-mt10' : 'c-mt12'" v-for="(item,index) in refundList" :key="index">
        <div class="c-bd-b1 c-flex-row c-justify-sb c-pv24">
          <div class="c-lh c-fc-gray c-fs20 c-flex-row c-aligni-center">
            {{item.applyAt}}
          </div>
          <div class="c-lh c-fs22" :class="[1, 4].includes(item.afterStatus) ? 'theme-fc' : ''">{{item.afterStatus == 2 ? '退款成功' : ([-1, -2, -3].includes(item.afterStatus) ? '退款关闭' : '退款中')}}</div>
        </div>
        <div class="c-flex-row c-pt20" @click="clickGoShop(item.mgId)">
          <div class="c-ww180 c-hh180 c-text-hidden c-br10">
            <img :src="$addXossFilter(item.avatar, require('@/assets/defult270.png'))" class="c-w100 c-h c-br10 imgCloseBig c-object-fit-cover" />
          </div>
          <div class="c-flex-column c-flex-grow1 c-w0 c-hh180 c-pl20 c-justify-sb">
            <div class="c-fs24 c-text-ellipsis1 c-lh34">{{item.name}}</div>
            <div class="c-fs20 c-fc-gray c-mt10 c-text-ellipsis3" v-if="item.subSpecs">规格：{{item.subSpecs}}</div>
            <div class="c-fs20 c-fc-xblack c-mt10">退款：{{'￥' | iosPriceFilter}}{{item.refundMoney}}</div>
          </div>
        </div>
        <div class="c-bg-sgray c-pv16 c-ph24 c-fs24 c-w100 c-br8 c-mt20 c-mt10" v-if="[1,2,-2].includes(item.refundStatus)">
          <template v-if="item.refundStatus==1">
            等待商家处理退款申请，还剩<span class="theme-fc"><cj-clocker :time="item.automaticTime * 1000" format="%D天%H小时%M分"></cj-clocker></span>
          </template>
          <template v-if="item.refundStatus==2">
            退款成功，退款金额：<span class="theme-fc">{{'￥' | iosPriceFilter}}{{item.refundMoney}}</span>
          </template>
          <template v-if="item.refundStatus==-2">
            商家拒绝退款申请，请在<span class="theme-fc"><cj-clocker :time="item.automaticTime * 1000" format="%D天%H小时%M分"></cj-clocker></span>内处理
          </template>
        </div>
        <div class="c-lh c-fs24 c-flex-row c-justify-end c-aligni-center c-pv24">
          <div class="c-bd1 c-br24 c-fs24 c-pv12 c-ph24 c-ml20" @click="goOrderSales(item.godId, item.gorId)">查看详情</div>
        </div>
      </div>
    </div>
    <div class="c-pf c-bg-white c-p-l0 c-p-r0 c-pv24 c-mlr-auto c-p-b0 c-ph24" v-show="type == 3">
      <div class="c-fc-xblack c-bd1-ccc c-br36 c-flex-row c-aligni-center c-justify-center c-fs24 c-lh34 c-ww600 c-hh64 c-mlr-auto" @click="goToCommentList">查看已评价内容</div>
    </div>
    <loading-status-tem :dataStatus="dataStatus" noDataText="暂无订单"></loading-status-tem>
  </div>
</template>

<script>
import loadingStatusTem from "@/components/templates/common/loadingStatusTem.vue";
import MySmallTabbar from "@/components/templates/common/MySmallTabbar.vue";
import { utilJs } from "@/utils/common.js";
import { mapState } from 'vuex';
let pageIndex = 1;
let getType = 1;
const LIMIT = 10;
export default {
  name: "MallOrderList",
  components: {
    loadingStatusTem,
    MySmallTabbar,
  },
  props: [],
  data() {
    return {
      theme: localStorage.getItem("colorName") ? localStorage.getItem("colorName") : "mb5_default",
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
      orderStatus: {
        '-5': "已关闭",
        '-4': "删除订单",
        '-3': "已关闭",
        '-2': "已关闭",
        '-1': "交易关闭",
        0: "待付款",
        1: "待发货",
        2: "待收货",
        3: "已收货",
        5: "已退款",
        6: "退款失败"
      },
      dataStatus: 'HAS_MORE_DATA',
      type: -1,
      operationGoid: "",
      isToPay: false,
      tabList: [
        {index: -1, title: '全部'},
        {index: 0, title: '待付款'},
        {index: 1, title: '待发货'},
        {index: 2, title: '待收货'},
        {index: 3, title: '待评价'},
        {index: 4, title: '退款/售后'}
      ],
      showDialog: false,
      refundList: [], // 退款售后列表
    };
  },
  computed: {
    ...mapState({
      orderList: state => state.oem_store.orderList
    }),
    showLogistics() {
      return function(item) {
        return [2, 3].includes(item.status) && item.deliverTypeArr &&
        ((item.deliverTypeArr.every(item => item == 1) && item.isSplitPackage == -1) || (item.isSplitPackage != -1 && !(item.deliverTypeArr.every(item => item == 3))))
      }
    }
  },
  beforeRouteLeave(to, from, next) {
    this.$cjConfirm.hide();
    next();
  },
  watch: {
    $route(to, from) {
      if (from.path == '/mall/shopSettlement/shopSettlement') { // 页面缓存情况下，当订单到结算页后再进入该页面重新加载列表
        this.type = -1;
        this.initData();
      }
      if (from.path == '/mall/mallOrder/orderDetail' && sessionStorage.getItem('filterOrder')) {
        let orderId = orderId = from.query.goId;
        let index = this.orderList.findIndex(item => item.orderId == orderId);
        if (this.dataStatus == "HAS_MORE_DATA") {
          getType = 2;
          this.getOrderList(index);
          sessionStorage.removeItem('filterOrder')
        }
      }
    },
    orderList() {
      if (this.orderList.length == 0) {
        this.dataStatus = "NO_DATA"
      }
    }
  },
  created() {
    utilJs.appShare(this);
  },
  mounted() { },
  methods: {
    // 跳转到订单售后
    goOrderSales(godId, gorId) {
      this.$routerGo(this, "push", {
        path: "/mall/mallOrder/orderAfterSales",
        query: ({
          godId: godId,
          gorId: gorId
        })
      });
    },
    // 修改地址
    handleClickAddress(goId) {
      this.$routerGo(this, "push", {
        path: "/mall/mallOrder/orderAddress",
        query: ({
          goId: goId
        })
      });
    },
    // 关闭支付有礼弹窗
    handleClickCloseDialog() {
      this.showDialog = false;
    },
    // 评论操作
    goComments(item) {
      this.$routerGo(this, "push", {
        path: this.type == -1 ? '/mall/shopComments/addShopComment' : '/mall/shopComments/addShopComment?orderType=' + this.type,
        query: ({
          goId: item.goId,
          type: 1 // 1添加订单评论
        })
      })
    },
    // 跳转到已评价页面
    goToCommentList() {
      this.$routerGo(this, "push", {
        path: "/mall/shopComments/shopCommentList",
        query: {
          type: 2
        }
      });
    },
    changeType: function (type) {
      this.type = type;
      this.isToPay = type == 0 ? true : false;
      pageIndex = 1;
      this.orderList = [];
      if (this.type == 4) {
        this.refundList = [];
        this.getRefundList();
        return
      }
      this.getOrderList();
    },
    //查看物流
    clickLogistics(index, isSplitPackage, goId) {
      this.$routerGo(this, "push", {
        path: '/mall/shippingAddress/addressList',
        query: {fromOrderDetail: 1, goId: goId}
      })
    },
    //确认收货
    clickConfirmReceipt(item) {
      let hasGorId = false;
      let goId = item.goId;
      if (item.orderDetail && item.orderDetail.length > 0) {
        item.orderDetail.forEach((item) => {
          if (item.afterStatus == 1) {
            hasGorId = true;
          }
        })
      }
      this.operationGoid = goId;
      let that = this;
      that.$cjConfirm({
        title: hasGorId ? '该订单中存在退款中的商品，确认收货将关闭退款' : '确认收货', //
        titleCenter: true, //标题是否居中
        message: '',
        messageCenter: true, //内容是否居中
        showMasker: true, //是否显示透明背景
        clickCloseModal: false, //是否点击透明背景关闭弹窗
        showCancelButton: true, //是否显示取消按钮
        cancelButtonText: '取消', //取消按钮文本
        confirmButtonText: '确定', //确认按钮文本
        onConfirm() {
          that.orderHandle(3)
        },
        onCancel() {
        },
      })
    },
    // 局部更新订单详情页面数据
    partUpateOrder(operactionInfo) {
      if (operactionInfo == null) {
        return
      }
      if (operactionInfo.operaction == 'editAddress') {
        // 不展示修改地址
        this.setOrderListAttribute(operactionInfo.goId, 'updateAddressTime', 1);
      } else if (operactionInfo.operaction == 'receiveOrder') {
        // 确认收货
        this.setOrderListAttribute(operactionInfo.goId, 'status', 3);
        // 当页面在待收货的tab页面
        if (this.type == 2) {
          this.filterOrderList(operactionInfo.goId);
        }
      } else if (operactionInfo.operaction == 'deleteOrder') {
        // 删除订单
        this.filterOrderList(operactionInfo.goId);
      } else if (operactionInfo.operaction == 'cancelOrder') {
        // 取消订单
        this.setOrderListAttribute(operactionInfo.goId, 'status', -5);
        // 当页面在待付款的tab页面
        if (this.type == 0) {
          this.filterOrderList(operactionInfo.goId);
        }
      }
    },
    // 设置订单的属性
    setOrderListAttribute(goId, name, value) {
      let orderList = this.orderList;
      orderList.forEach((item, index) => {
        if (item.goId == goId) {
          this.$set(orderList[index], name, value)
        }
      })
      this.$store.commit('updateOrderList', orderList);
    },
    // 过滤订单
    filterOrderList (goId) {
      let orderList = this.orderList;
      let list = orderList.filter(item => item.goId != goId);
      this.$store.commit('updateOrderList', list);
    },
    //点击取消订单
    clickCancelOrder(goId, status) {
      this.operationGoid = goId;
      let that = this;
      if (status == 2) { // 取消订单弹窗展示
        that.$cjConfirm({
          title: '确认取消该订单', //
          titleCenter: true, //标题是否居中
          message: '',
          messageCenter: true, //内容是否居中
          showMasker: true, //是否显示透明背景
          clickCloseModal: false, //是否点击透明背景关闭弹窗
          showCancelButton: true, //是否显示取消按钮
          cancelButtonText: '取消', //取消按钮文本
          confirmButtonText: '确定', //确认按钮文本
          onConfirm() {
            that.orderHandle(-2)
          },
          onCancel() {
          },
        })
      } else { // 删除订单
        that.$cjConfirm({
          title: '确定要删除该订单', //
          titleCenter: true, //标题是否居中
          message: '',
          messageCenter: true, //内容是否居中
          showMasker: true, //是否显示透明背景
          clickCloseModal: false, //是否点击透明背景关闭弹窗
          showCancelButton: true, //是否显示取消按钮
          cancelButtonText: '', //取消按钮文本
          confirmButtonText: '', //确认按钮文本
          onConfirm() {
            utilJs.getMethod(
              global.apiurl + "goodsOrders/deleteClosedOrder/" + goId, (res) => {
                that.$showCjToast({
                  text: res,
                  type: "success",
                  time: 1000
                });
                let operactionInfo = {
                  goId: goId,
                  operaction: 'deleteOrder'
                }
                that.partUpateOrder(operactionInfo);
              }
            )
          },
          onCancel() {
          },
        })
      }
    },
    //操作订单
    orderHandle(status) {
      utilJs.postMethod(
        global.apiurl + "goodsOrders/orderHandle",
        {
          status: status,
          goId: this.operationGoid
        },
        res => {
          this.$showCjToast({
            text: status == -2 ? "订单已取消" : res,
            type: "success",
            time: 1500
          });
          if (status == -2) { // 取消订单
            let operactionInfo = {
              goId: this.operationGoid,
              operaction: 'cancelOrder'
            }
            this.partUpateOrder(operactionInfo);
          } else if (status == 3) { // 确认收货
            let operactionInfo = {
              goId: this.operationGoid,
              operaction: 'receiveOrder'
            }
            this.partUpateOrder(operactionInfo);
          }
        }
      );
    },
    clickGoShop(shopNo) {
      this.$routerGo(this, "push", {
        path: "/mall/shopDetail/shopDetail",
        query: { shopNo: shopNo }
      });
    },
    clickPay(gItem) {
      let goPathg = gItem.collageId
        ? "/mall/mallOrder/orderDetail?goId=" + gItem.goId + "&collageId=" + gItem.collageId + "&type=" + this.type
        : "/mall/mallOrder/orderDetail?goId=" + gItem.goId + "&type=" + this.type;
      this.$routerGo(this, "push", {
        path: goPathg
      });
    },
    closePay() {
      this.isShowPay = false;
    },
    // 价格样式分割
    priceStyleChange(price) {
      if (price == 'free') { //实际付款价格允许显示0.00
        price = '0.00'
      } else {
        price = (price * 1 + 0.00000001).toFixed(2); // 防止字段传number型数据
      }
      if ((price * 1) == 0) {
        return price;
      }
      let splitPrice = (price.toString().replace(/-/g, '')).split('.')
      let afterPrice = `${splitPrice[0]}.<span class="c-fs20">${splitPrice[1]}</span>`;
      return afterPrice;
    },
    // v-html赋值
    setPriceHtml(item) {
      item.postage = (item.postage && item.postage * 1 > 0) ? this.priceStyleChange(item.postage) : this.priceStyleChange('0.00');
      item.totalDiscountPrice = (item.totalDiscountPrice && item.totalDiscountPrice * 1 != 0) ? this.priceStyleChange(item.totalDiscountPrice) : this.priceStyleChange('0.00');
      item.payMoney = (item.payMoney && item.payMoney * 1 > 0) ? this.priceStyleChange(item.payMoney) : this.priceStyleChange('free');
    },
    // 获取退款售后列表
    getRefundList() {
      if (this.dataStatus == 'LOADING') {
        return;
      }
      this.dataStatus = 'LOADING';
      this.$loading.show();
      utilJs.getMethod(global.apiurl + "mall/getRefundList?page=" + pageIndex + "&limit=" + LIMIT,
        res => {
          if (pageIndex == 1) {
            this.refundList = res.data ? res.data : [];
          } else {
            this.refundList = [...this.refundList, ...res.data];
          }
          this.$loading.hide();
          if (res.data && (res.data.length < LIMIT)) {
            this.dataStatus = (res.data && res.data.length == 0 && pageIndex == 1) ? 'NO_DATA' : 'NO_MORE_DATA';
          } else {
            this.dataStatus = 'HAS_MORE_DATA';
            pageIndex++;
          }
        }, failRes => {
          this.dataStatus = 'DATA_ERROR';
        }
      );
    },
    //获取订单列表
    getOrderList(index) {
      if (getType == 2 && index == undefined) {
        getType = 1;
        return
      }
      if (getType == 1) {
        if (this.dataStatus == 'LOADING') {
          return;
        }
          this.dataStatus = 'LOADING';
          this.$loading.show();
      }
      let page = getType == 2 ? parseInt(index / 10) + 1 : pageIndex;
      let type = this.type == 3 ? 1 : '';
      let t = this.type == -1 ? '' : this.type;
      utilJs.getMethod(
        global.apiurl +
        "goodsOrders/orderList?page=" +
        page +
        "&status=" +
        t +
        '&type=' +
        type,
        res => {
          let orderList = this.orderList;
          if (getType == 1) {
            if (pageIndex == 1) {
              orderList = res.list.data ? res.list.data : [];
              orderList.forEach((item, index) => {
                item.totalDiscountPrice * 1 > 0 ? orderList[index].totalDiscountSign = 1 : orderList[index].totalDiscountSign = 0;
                this.setPriceHtml(item);
              })
            } else {
              let list = res.list.data;
              list.forEach((item, index) => {
                item.totalDiscountPrice * 1 > 0 ? list[index].totalDiscountSign = 1 : list[index].totalDiscountSign = 0;
                this.setPriceHtml(item);
              })
              orderList = [...orderList, ...list];
            }
            this.$loading.hide();
            if (res.list.to * 1 == res.list.total * 1) {
              this.dataStatus = res.list.total * 1 == 0 ? 'NO_DATA' : 'NO_MORE_DATA';
            } else {
              this.dataStatus = 'HAS_MORE_DATA';
              pageIndex++;
            }
          } else {
            let item = res.list.data[res.list.data.length - 1];
            orderList.push(item);
            getType = 1;
          }
          this.$store.commit('updateOrderList', orderList);
        },
        failRes => {
          this.dataStatus = 'DATA_ERROR';
        }
      );
    },
    //分享
    wechatShare: function () {
      let shareUrl =
        window.location.href.split("#")[0] +
        "#/?refereeId=" +
        localStorage.getItem("userId");
      utilJs.wechatConfig(shareUrl, "", "", "", function () { });
    },
    //手机端分享
    appShare: function () {
      var shareUrl =
        window.location.href.split("#")[0] +
        "#/?refereeId=" +
        localStorage.getItem("userId");
      utilJs.appShareTrue("", "", shareUrl, "");
    },
    windowScrollFunction: function () {
      utilJs.handleLoading(() => {
        if (this.dataStatus == 'HAS_MORE_DATA' && (this.orderList.length > 0 || this.refundList.length > 0)) {
          if (this.type != 4) {
            this.getOrderList();
          } else {
            this.getRefundList();
          }
        }
      });
    },
    initData() {
      this.dataStatus = 'HAS_MORE_DATA';
      this.orderList = [];
      pageIndex = 1;
      getType = 1;
      this.getOrderList();
    }
  },
  activated() {
    setDocumentTitle("商城订单");// eslint-disable-line
    this.wechatShare();
    this.isShowPay = false;
    this.cancelGoid = "";
    // 退款售后列表每次进去页面都更新
    if (this.type == 4) {
      pageIndex = 1;
      this.refundList = [];
      this.dataStatus = 'HAS_MORE_DATA';
      this.getRefundList();
    }
    if (utilJs.checkNeedInitData(this.orderList)) {
      this.initData()
    }
    window.addEventListener('scroll', this.windowScrollFunction);
  },
  deactivated() {
    window.removeEventListener('scroll', this.windowScrollFunction);
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.jt{
  position: absolute;
  bottom: -0.5rem;
  right: 1.25rem;
  width: 0;
  height: 0;
  border-left: 0.25rem solid transparent;
  border-right: 0.25rem solid transparent;
  border-top: 0.5rem solid #fafbfc;
}
.orderList /deep/ .dialog-modal .weui-dialog {
  border-radius: .5rem!important;
}
.boxShadow {
  box-shadow: 0px 0px 9px 0px rgba(204,204,204,0.20);
}
</style>
